home *** CD-ROM | disk | FTP | other *** search
/ Acorn RISC PD-CD 1 / Acorn RISC PD-CD 1.iso / languages / grs / pd_release / g / person < prev    next >
Encoding:
Text File  |  1991-03-28  |  1.1 KB  |  50 lines

  1. instanceof class person;
  2.  
  3. assume string name; integer age in
  4. {
  5.  
  6. person := class.new(
  7.              "person",
  8.              [
  9.                 {
  10.                    null function hello2()
  11.                    {
  12.                       assume null function hello(string s) in
  13.                       {
  14.                         let string s := "Guy";
  15.                         hello(s);
  16.                       };
  17.                    };
  18.                 },
  19.  
  20.                 {
  21.                    null function hello(string s)
  22.                    {
  23.                       write("Hello ",s,"\n");
  24.                    };
  25.                 },
  26.  
  27.                 {
  28.                    null function set(string namep; integer agep)
  29.                    {
  30.                       name := namep;
  31.                       age := agep;
  32.                    };
  33.                 },
  34.  
  35.                 {
  36.                    null function show()
  37.                    {
  38.                       write(name," is ",age," years old.\n");
  39.                    };
  40.                 }
  41.  
  42.              ],
  43.              [{
  44.                  integer age;
  45.                  string name;
  46.              }]
  47.              );
  48. };
  49.  
  50.